package edu.chalmers.Framework_EXAMPLES;

import edu.chalmers.AV_2DPlatformerFramework.Model.GameObject;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox.HitboxMalformedException;
import edu.chalmers.AV_2DPlatformerFramework.Model.Texture;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;
/**
 *
 * @author Richard
 */
public class EXAMPLE_Object_TheDude extends GameObject {
    
    public EXAMPLE_Object_TheDude() throws Hitbox.HitboxMalformedException{
//        super(new Hitbox(new int[]{30,60,60,50,50,60,80,90,80,80,70,60,60,70,70,80,80,50,50,40,40,10,10,20,20,30,30,20,10,10,00,30,40,40,30,30},
//              new int[]{210,210,180,180,170,170,120,110,100,110,160,100,80,20,20,0,0,80,80,0,0,20,20,80,100,160,110,100,110,110,120,170,170,180,180,210}, 36));
        super(null);
            Vector2D[] vertices = {new Vector2D(30, 0), new Vector2D(60, 0), 
                new Vector2D(90, 30), new Vector2D(90, 60), new Vector2D(60, 90), 
                new Vector2D(30, 90), new Vector2D(0, 60), new Vector2D(0, 30)};
        this.setHitbox(new Hitbox(vertices));
        String s = System.getProperty("file.separator");
        addTexture(                new Texture("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"TheDude_Texture_R0.gif", this.getHitbox().getBounds2D()));
    }
    


    
    @Override
    public void onCollision(GameObject otherObject) {
//        System.out.println("dude!");
    }

    @Override
    public GameObject copy() {
        try {
            EXAMPLE_Object_TheDude copy = new EXAMPLE_Object_TheDude();
            this.copyVariablesTo(copy);
            return copy;
        } catch (HitboxMalformedException ex) {
            return null;
        }
    }
    
}
